#pragma once
#include "d3dtypes.h"
#include "d3d.h"
#include "types.h"
namespace rendering
{
	namespace gbuffer
	{
		struct GBuffer
		{
			d3d::Texture2D* albedo;
			d3d::Texture2D* normal;
			d3d::Texture2D* depth;
			union
			{
				struct 
				{
					d3d::ShaderResourceView* albedo_srv;
					d3d::ShaderResourceView* normal_srv;
					d3d::ShaderResourceView* depth_srv;
				};
				d3d::ShaderResourceView* srvs[3];
			};
			union
			{
				struct 
				{
					d3d::RenderTargetView* albedo_rtv;
					d3d::RenderTargetView* normal_rtv;
				};
				d3d::RenderTargetView* rtvs[2];
			};

			d3d::DepthStencilView* depth_dsv;
		};
		GBuffer create(shared_ptr<d3d::DXDevice> device, Size size);
		void destroy(GBuffer gbuffer);
		void resize(shared_ptr<d3d::DXDevice> device, GBuffer* gbuffer, Size size);
	}
}